package org.jason.article.mq.producer;

import org.jason.model.interaction.dtos.ArticleInteractionDto;
import org.jason.model.article.dtos.ContributeDto;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ArticleProducer {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    //投稿文章队列
    public void contributeQueue(ContributeDto dto) {
        rabbitTemplate.convertAndSend("contribute.queue", dto);
    }

    //文章互动队列
    public void IncreasedViewCount(ArticleInteractionDto dto) {
        rabbitTemplate.convertAndSend("article.behavior.queue", dto);
    }
}
